﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using PDBSmartMVVM.model;

namespace PDBSmartMVVM.viewmodel
{
    public class TreeViewModel : WorkspaceViewModel
    {

        private ObservableCollection<ModelTreeViewModel> _models;
        public ObservableCollection<ModelTreeViewModel> Models
        {
            get { return _models; }
            set
            {
                if (value != _models)
                {
                    _models = value;
                    OnPropertyChanged("Models");
                }
            }
        }


        public TreeViewModel(Dictionary<int, List<Amino>> models, string fileName, ObservableCollection<object> objects)
        {
            DisplayName = fileName;
            Models = new ObservableCollection<ModelTreeViewModel>();
            foreach (var aminos in models)
            {
                Models.Add(new ModelTreeViewModel(null, new Model()
                    {
                        Aminos = aminos.Value, 
                        Number = aminos.Key
                    }, objects));
                
            }
        }
    }
}

